import { GameMode, Player, world } from "@minecraft/server";
import { Dimensions } from "@sapi-game/constants";

export function start(p: Player) {
    if (!p.isValid) return;
    p.onScreenDisplay.setTitle("§e烤肠派对大厅");
    p.setGameMode(GameMode.Adventure);
}

export class KcpdFuncs {
    /**传送玩家到烤肠派对大厅 */
    static hub(p: Player) {
        if (!p.isValid) return;
        p.runCommand("function kcpd/hub");
    }

    /**重置门 */
    static reloadDoor() {
        world.structureManager.place("kc_门", Dimensions.Overworld, {
            x: -159,
            y: -59,
            z: -386,
        });
    }
}
